package com.guli.mall.controller;

import com.guli.common.to.SpuEsTo;
import com.guli.common.utils.R;
import com.guli.mall.service.ProductService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

/*
 * @Author 罗
 * @date 2020/10/9 - 6:53 下午
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @Resource
    ProductService productService;

    @PostMapping("/save")
    public R saveToProduct(@RequestBody List<SpuEsTo> spuEsToList) throws IOException {

        productService.saveToProduct(spuEsToList);

        return R.ok();
    }

}
